package com.controller.pay;


import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/diagnose")
@Api(value = "收费发药",tags = "收费发药")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=405,message="请求方法错误"),
        @ApiResponse(code=500,message="后台服务错误")
})
public class SeeDoctorController {


    /**
     * 查询诊断单基本信息
     * @param currentPage
     * @param pageSize
     * @param keywords
     * @param status
     * @return
     */

    @GetMapping("/queryBaseMsg")
    @ApiOperation(value = "显示诊断单基本信息",notes = "查询所有诊断单基本信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页的条数",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "keywords",value = "每页的条数",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "status",value = "每页的条数",paramType = "query",dataType = "int",required = true),
    })
    public String queryBaseMsg(String currentPage,String pageSize,String keywords,String status){




        return "{\n" +
                "  \"code\": 200,\n" +
                "  \"msg\": \"查询成功！\",\n" +
                "  \"data\": [\n" +
                "    {\n" +
                "      \"id\": 100001,\n" +
                "      \"doctor\": \"杨医生\",\n" +
                "      \"seeDoctorTime\": \"2002-11-1 12:11:18\",\n" +
                "      \"money\": \"消费金额\",\n" +
                "      \"status\": 0,\n" +
                "      \"patientBank\": {\n" +
                "        \"bankName\": \"于和伟\",\n" +
                "        \"sex\": \"男\",\n" +
                "        \"age\": 18,\n" +
                "        \"phone\": \"18187879878\"\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"id\": 100001,\n" +
                "      \"doctor\": \"杨医生\",\n" +
                "      \"seeDoctorTime\": \"2002-11-1 12:11:18\",\n" +
                "      \"money\": \"消费金额\",\n" +
                "      \"status\": 0,\n" +
                "      \"patientBank\": {\n" +
                "        \"bankName\": \"于和伟\",\n" +
                "        \"sex\": \"男\",\n" +
                "        \"age\": 18,\n" +
                "        \"phone\": \"18187879878\"\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"id\": 100001,\n" +
                "      \"doctor\": \"杨医生\",\n" +
                "      \"seeDoctorTime\": \"2002-11-1 12:11:18\",\n" +
                "      \"money\": \"消费金额\",\n" +
                "      \"status\": 0,\n" +
                "      \"patientBank\": {\n" +
                "        \"bankName\": \"于和伟\",\n" +
                "        \"sex\": \"男\",\n" +
                "        \"age\": 18,\n" +
                "        \"phone\": \"18187879878\"\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"id\": 100001,\n" +
                "      \"doctor\": \"杨医生\",\n" +
                "      \"seeDoctorTime\": \"2002-11-1 12:11:18\",\n" +
                "      \"money\": \"消费金额\",\n" +
                "      \"status\": 0,\n" +
                "      \"patientBank\": {\n" +
                "        \"bankName\": \"于和伟\",\n" +
                "        \"sex\": \"男\",\n" +
                "        \"age\": 18,\n" +
                "        \"phone\": \"18187879878\"\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"id\": 100001,\n" +
                "      \"doctor\": \"杨医生\",\n" +
                "      \"seeDoctorTime\": \"2002-11-1 12:11:18\",\n" +
                "      \"money\": \"消费金额\",\n" +
                "      \"status\": 0,\n" +
                "      \"patientBank\": {\n" +
                "        \"bankName\": \"于和伟\",\n" +
                "        \"sex\": \"男\",\n" +
                "        \"age\": 18,\n" +
                "        \"phone\": \"18187879878\"\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"id\": 100001,\n" +
                "      \"doctor\": \"杨医生\",\n" +
                "      \"seeDoctorTime\": \"2002-11-1 12:11:18\",\n" +
                "      \"money\": \"消费金额\",\n" +
                "      \"status\": 0,\n" +
                "      \"patientBank\": {\n" +
                "        \"bankName\": \"于和伟\",\n" +
                "        \"sex\": \"男\",\n" +
                "        \"age\": 18,\n" +
                "        \"phone\": \"18187879878\"\n" +
                "      }\n" +
                "    }\n" +
                "  ]\n" +
                "}\n";
    }

    /**
     *获取处方详情等。。
     * @param diagnoseId
     * @return
     */
    @GetMapping("/queryScriptBydiaId")
    @ApiOperation(value = "获取处方详情和服药详情等",notes = "点击门诊编号")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String queryScriptBydiaId(String diagnoseId){


        return "{\n" +
                "\t\"code\": 200,\n" +
                "\t\"msg\": \"查询成功！\",\n" +
                "\t\"data\": [{\n" +
                "\t\t\"rxId\": 100001,\n" +
                "\t\t\"rxName\": \"处方1\",\n" +
                "\t\t\"drugName\": \"干草\",\n" +
                "\t\t\"drugNumber\": 1,\n" +
                "\t\t\"price\": 11.0,\n" +
                "\t\t\"amount\": 11.0,\n" +
                "\t\t\"rxType\": \"\",\n" +
                "\t\t\"remarks\": \"中药备注\",\n" +
                "\t\t\"medicationRequirements\": \"服药要求\"\n" +
                "\t}, {\n" +
                "\t\t\"rxId\": 100001,\n" +
                "\t\t\"rxName\": \"处方1\",\n" +
                "\t\t\"drugName\": \"干草\",\n" +
                "\t\t\"drugNumber\": 1,\n" +
                "\t\t\"price\": 11.0,\n" +
                "\t\t\"amount\": 11.0,\n" +
                "\t\t\"rxType\": \"\",\n" +
                "\t\t\"remarks\": \"中药备注\",\n" +
                "\t\t\"medicationRequirements\": \"服药要求\"\n" +
                "\t}, {\n" +
                "\t\t\"rxId\": 100001,\n" +
                "\t\t\"rxName\": \"处方2\",\n" +
                "\t\t\"drugName\": \"CT\",\n" +
                "\t\t\"drugNumber\": 1,\n" +
                "\t\t\"price\": 11.0,\n" +
                "\t\t\"amount\": 11.0,\n" +
                "\t\t\"rxType\": \"化验类\",\n" +
                "\t\t\"remarks\": \"中药备注\",\n" +
                "\t\t\"medicationRequirements\": \"服药要求\"\n" +
                "\t}]\n" +
                "}";
    }


    /**
     * 收取费用（该请求请求支付宝接口，
     * @param diagnoseId
     * @return
     */
    @PostMapping("/prePayMoney")
    @ApiOperation(value = "收取费用（该请求请求支付宝接口，）",notes = "收费之前")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String prePayMoney(String diagnoseId){


        return "";
    }

    /**
     * 真正收费
     * @param diagnoseId
     * @return
     */
    @PostMapping("/payMoney")
    @ApiOperation(value = "收费，将后台状态改为1，这个请求必须等待支付宝接口成功后\n" +
            "再执行！！，后台会验证支付宝接口",notes = "真正收费")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String payMoney(String diagnoseId){



        return "{\n" +
                "\t\"code\": 200,\n" +
                "\t\"msg\": \"收费成功！\",\n" +
                "\t\"data\": []\n" +
                "}";
    }


    /**
     * 发药
     * @param diagnoseId
     * @return
     */
    @PostMapping("/releseDrug")
    @ApiOperation(value = "药房发药",notes = "发药")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String releseDrug(String diagnoseId){

        return "{\n" +
                "\t\"code\": 200,\n" +
                "\t\"msg\": \"发药成功！\",\n" +
                "\t\"data\": []\n" +
                "}";
    }


    /**
     * 退款，订单记录按钮
     * @param diagnoseId
     * @return
     */
    @GetMapping("/preReleseDrug")
    @ApiOperation(value = "订单记录，退款按钮请求地址 ,执行退款（退款之前，先拿到该诊断单的处方信息，交易信息,默认先显示的处方信息内容",notes = "订单列表/退款")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String preReleseDrug(String diagnoseId){


        return "{\n" +
                "\t\"code\": 200,\n" +
                "\t\"msg\": \"成功！\",\n" +
                "\t\"data\": [\n" +
                "\t  {\n" +
                "\t  \t\"rxName\":\"处方1\",\n" +
                "\t\t\"amount\":200\n" +
                "\t  },\n" +
                "\t  \t  {\n" +
                "\t  \t\"rxName\":\"处方2\",\n" +
                "\t\t\"amount\":100\n" +
                "\t  },\n" +
                "\t]\n" +
                "}";
    }


    @GetMapping("/showTradeInfoPay")
    @ApiOperation(value = "通过这个id拿到支付记录",notes = "支付记录按钮")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String showTradeInfoPay(String diagnoseId){

        return "{\n" +
                "\t\"code\": 200,\n" +
                "\t\"msg\": \"成功！\",\n" +
                "\t\"data\": [{\n" +
                "\t\t\"type\": \"现金\",\n" +
                "\t\t\"createDate\": \"2022 - 1 - 1 12: 00: 00\",\n" +
                "\t\t\"money\": 100\n" +
                "\n" +
                "\t}]\n" +
                "}";
    }


    @GetMapping("/showTradeInfoOut")
    @ApiOperation(value = "通过这个id拿到退款记录",notes = "退款记录按钮")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "diagnoseId",value = "诊断单编号",paramType = "query",dataType = "int",required = true),
    })
    public String showTradeInfoOut(String diagnoseId){
        return "{\n" +
                "\t\"code\": 200,\n" +
                "\t\"msg\": \"成功！\",\n" +
                "\t\"data\": [{\n" +
                "\t\t\"type\": \"支付宝\",\n" +
                "\t\t\"createDate\": \"2022 - 1 - 1 12: 00: 00\",\n" +
                "\t\t\"money\": 100\n" +
                "\n" +
                "\t}]\n" +
                "}";
    }
}
